﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;

namespace CleanBackup.Helpers
{
	class BoolToVisibleValueConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			bool isVisible = (bool)value;

			if (isVisible == true)
				return Visibility.Visible;
			else
				return Visibility.Hidden;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			Visibility isTrue = (Visibility)value;

			if (isTrue == Visibility.Visible)
				return true;
			else
				return false;
		}
	}
}
